package forceoffer;


import java.util.Scanner;
/**
 * 二维数组搜索
 */
public class FindArray {
    public static void main(String args[]) {

        int[][] array=new int[8][8];
        for (int i=0; i<8; i++) {
            for (int j=0; j<8; j++) {
                array[i][j]=(i+2)*(j+1);
            }
        }
        //for (int i=0; i<8; i++) {
        //  System.out.println(Arrays.toString(array[i]));
        //}
        Scanner in=new Scanner(System.in);
        int target=in.nextInt();
        System.out.println(Find(target,array));
    }

    public static boolean Find(int target,int[][] array){

        if (array[0][0]>target || array[array.length-1][array[0].length-1]<target) {
            return false;
        }
        int rangestart=0;
        int rangeend=array.length-1;
        int columstart=0;
        int columend=array[0].length-1;
        int rangmid=rangeend/2;
        int colummid=columend/2;
        while(rangestart<=rangeend && columstart<=columend){
            rangmid=(rangestart+rangeend)/2;
            colummid=(columstart+columend)/2;
            if (rangestart==rangeend && columstart==columend && array[rangmid][colummid]!=target) {
                return false;
            }
            if (array[rangmid][colummid]==target) {
               break;
            }
            if (array[rangmid][colummid]<target) {
                rangestart=rangmid+1;
                columstart=colummid+1;
            }
            if(array[rangmid][colummid]>target){
                rangeend=rangmid-1;
                columend=colummid-1;
            }
        }
        if (array[rangmid][colummid]==target){
            return true;
        }else{
            return false;
        }
    }
}
